import request from "../utils/request";

// 获取邮箱验证码
export async function sendReBindGoogleSecretEmail(params) {
    return await request.post('retrieve/sendReBindGoogleSecretEmail', params)
}

// 获取谷歌验证器
export async function generateGoogleSecretKey(params) {
    return await request.post('retrieve/generateGoogleSecretKey', params)
}

// 获取谷歌验证器QrCode
export async function generateGoogleSecretQrCode(params) {
    return await request.get('retrieve/generateGoogleSecretQrCode', {params: params, responseType: "arraybuffer"})
}

<<<<<<< HEAD
// 重新绑定谷歌验证器SecretKey
export async function resetGoogleSecretKey(params) {
    return await request.post('retrieve/resetGoogleSecretKey', params)
=======
export async function loginOut(params) {
    return await request.get('system/out', {params})
}

export async function updatePassword(params) {
    return await request.post('system/updatePassword', params)
}

// 获取谷歌验证器密钥
export async function fetchGoogleSecretKey(params) {
    return await request.get('system/generateGoogleSecretKey', {params})
}

// 获取谷歌验证器二维码
export async function fetchGoogleSecretQrCode(params) {
    return await request.get('system/generateGoogleSecretQrCode', {params: params, responseType: "arraybuffer"})
}

//绑定google验证器
export async function bindGoogleSecret(params) {
    return await request.post('system/bindGoogleSecret', params)
}

//重新绑定谷歌验证器SecretKey
export async function getResetGoogleSecretLink(params) {
    return await request.post('system/getResetGoogleSecretLink', params)
}

//二次登录
export async function secondaryLogin(params) {
    return await request.post('system/secondLogin', params)
}

// 获取商户下拉列表
export async function selectMerchant(params) {
    if (requestFilter('merchant/merchantListDropDown')) {
        const res = await request.post('merchant/merchantListDropDown', params)
        return res.code === 200 ? res.data : []
    } else {
        return []
    }
}

// 首页资金统计
export async function fetchHomeMoney(params = {}) {
    if (requestFilter('home/fundStatistics')) {
        return await request.post('home/fundStatistics', params)
    } else {
        return {}
    }
}

// 今日数据统计
export async function fetchHomeTodayMoney(params = {}) {
    if (requestFilter('home/todayStatistics')) {
        return await request.post('home/todayStatistics', params)
    } else {
        return {}
    }
}

// 未指定商户列表
export async function fetchCollectionUnknown(params = {}) {
    return await request.post('collectionUnknown/list', params)
}

// 未指定商户导出
export async function collectionUnknownExport(params = {}) {
    return await request.post('collectionUnknown/export', params)
}

// 切换指定商户
export async function changeCollectionUnknown(params = {}) {
    return await request.post('collectionUnknown/appointMerchant', params)
>>>>>>> 677035752ee182dbb0d99276546cbba2245e14ff
}
